package com.fengshang.wedding.domain.service.api;

import java.util.Collection;

import com.fengshang.wedding.domain.model.api.IMessage;

/**
 * 
 *@author gembin@gmail.com
 * 
 */
public interface IMessageManager {
	/**
	 * update a message
	 * @param message
	 * @return
	 * @throws MessageNotFoundException
	 */
	public IMessage updateMessage(IMessage message)throws MessageNotFoundException;
	/**
	 * create a new message for a topic (i.e. the replies of a topic)
	 * @param topicId
	 * @param message
	 */
	public void createMessage(int topicId, IMessage message)throws InvalidTopicException;
	/**
	 * remove a message
	 * @param messageId
	 * @throws MessageNotFoundException
	 */
	public void removeMessage(int messageId)throws MessageNotFoundException;
	/**
	 * find all the messages related to a topic
	 * @param topicId
	 * @param pageSize
	 * @param currentPage
	 * @return Collection of topics
	 */
	public Collection<IMessage> findTopicMessagesByPagination(int topicId,
			int pageSize, int currentPage);
	/**
	 * query messages
	 * @param query
	 * @param pageSize
	 * @param currentPage
	 * @return Collection of message
	 */
	public Collection<IMessage> findMessagesByPagination(String query,
			int pageSize, int currentPage);
	/**
	 * total Pages of message
	 * @param pageSize
	 * @return total Pages
	 */
	public int getTotalPages(int pageSize);
	/**
	 * total Pages of message
	 * @return total Pages
	 */
	public int getTotalPages();

}
